package com.vargas.studypartner;

import Util.ErrorHelper;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * Initial activity of the application that displays the main menu:
 * 1)New Class
 * 2)Open Class
 * 3)Quick Notes
 * 4)Import
 * */
public class MainActivity extends Activity {
	
	/**
	 * Sets the content view and event listeners to be used by this activity.
	 * @param	savedInstanceState	The instance state of the application.{@link Bundle}
	 * */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button btnQuickNotes = (Button) findViewById(R.id.btnQuickNotes);
        btnQuickNotes.setOnClickListener(CreateQuickNotesButtonClickListener());
    }
    
    /**
     * Click handler for the Quick Notes button
     * */
    private OnClickListener CreateQuickNotesButtonClickListener(){
    	return new OnClickListener() {
			@Override
			public void onClick(View v) {
				try {
					Intent QuickNotes = new Intent(v.getContext(), QuickNotesActivity.class);
					startActivity(QuickNotes);
				} catch(Exception e) {
					ErrorHelper.reportError(MainActivity.this, e);
				}
			}
		};
    }
}